package com.xzavier.yunlian_interview.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.ibatis.type.BlobTypeHandler;

import java.io.Serializable;
import java.sql.Blob;

@Data
@ToString
@EqualsAndHashCode
@TableName("user")
public class User implements Serializable {
    // 用户ID，主键
    @TableId("id")
    private String id;

    // 用户名
    private String username;
    @JsonIgnore
    private String password;

    // 昵称
    @TableField("nickName")
    private String nickName;

    // 头像URL
    @TableField(value = "avatar", typeHandler = BlobTypeHandler.class)
    private byte[] avatar;

    // 令牌
    private String token;


    // 分享信息
    @TableField("shareInfo")
    private String shareInfo;

    // 总时间（秒数）
    @TableField("totalTime")
    private int totalTime;

    // 签到次数
    @TableField("clockinNumbers")
    private int clockinNumbers;
    @JsonIgnore
    private String salt;

}
